-
Notifications
You must be signed in to change notification settings - Fork 8.1k
SPI support for pse84 and psc3 devices #97820
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Peterson-Brett
commented
Oct 17, 2025
- Adding SPI PDL driver
- Adding spi loopback overlays for pse84
- Adding spi loopback overlays for psc3
|
Hello @Peterson-Brett, and thank you very much for your first pull request to the Zephyr project! |
e1bd17c to
8339b0f
Compare
8339b0f to
b9bf3ab
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just tiny comments, all looks good to me otherwise.
drivers/spi/Kconfig.ifx_cat1
Outdated
|
|
||
| config IFX_CAT1_SPI_DMA | ||
| bool "Infineon CAT1 SPI Interrupt Support" | ||
| default n |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to, it's by default unset.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed 'default n'
drivers/spi/spi_ifx_cat1_pdl.c
Outdated
| cy_cb_scb_spi_handle_events_t spi_handle_events_func; | ||
|
|
||
| uint8_t cs_oversample_cnt; | ||
| uint8_t cs_oversample[32]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reverse the order, and move it at the end of the structure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The suggested change has been implemented.
| uint32_t tx_buffer_size; | ||
| bool is_async; | ||
| ifx_cat1_event_callback_data_t callback_data; | ||
| cy_stc_syspm_callback_t spi_deep_sleep; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re-order the attributes so the structure is better aligned.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I improved the ordering. @tbursztyka, please let me know if you think more should be done here.
| CONFIG_SERIAL=y | ||
|
|
||
| # Main Stack Size | ||
| CONFIG_MAIN_STACK_SIZE=2048 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be done at the application level as required
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has been removed.
drivers/spi/spi_ifx_cat1_pdl.c
Outdated
| #define LOG_LEVEL CONFIG_SPI_LOG_LEVEL | ||
| #include <zephyr/logging/log.h> | ||
| LOG_MODULE_REGISTER(cat1_spi); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| #define LOG_LEVEL CONFIG_SPI_LOG_LEVEL | |
| #include <zephyr/logging/log.h> | |
| LOG_MODULE_REGISTER(cat1_spi); | |
| #include <zephyr/logging/log.h> | |
| LOG_MODULE_REGISTER(cat1_spi, CONFIG_SPI_LOG_LEVEL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The suggested change has been implemented.
| #include <zephyr/drivers/pinctrl.h> | ||
| #include <zephyr/drivers/spi.h> | ||
| #include <zephyr/drivers/clock_control/clock_control_ifx_cat1.h> | ||
| #include <zephyr/dt-bindings/clock/ifx_clock_source_common.h> | ||
|
|
||
| #ifdef CONFIG_IFX_CAT1_SPI_DMA | ||
| #include <zephyr/drivers/dma.h> | ||
| #endif | ||
|
|
||
| #include <zephyr/kernel.h> | ||
| #include <cy_scb_spi.h> | ||
| #include <cy_trigmux.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| #include <zephyr/drivers/pinctrl.h> | |
| #include <zephyr/drivers/spi.h> | |
| #include <zephyr/drivers/clock_control/clock_control_ifx_cat1.h> | |
| #include <zephyr/dt-bindings/clock/ifx_clock_source_common.h> | |
| #ifdef CONFIG_IFX_CAT1_SPI_DMA | |
| #include <zephyr/drivers/dma.h> | |
| #endif | |
| #include <zephyr/kernel.h> | |
| #include <cy_scb_spi.h> | |
| #include <cy_trigmux.h> | |
| #include <zephyr/drivers/pinctrl.h> | |
| #include <zephyr/drivers/spi.h> | |
| #include <zephyr/drivers/clock_control/clock_control_ifx_cat1.h> | |
| #include <zephyr/dt-bindings/clock/ifx_clock_source_common.h> | |
| #include <zephyr/kernel.h> | |
| #ifdef CONFIG_IFX_CAT1_SPI_DMA | |
| #include <zephyr/drivers/dma.h> | |
| #endif | |
| #include <cy_scb_spi.h> | |
| #include <cy_trigmux.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The suggested change has been implemented.
| cy_stc_scb_spi_config_t scb_spi_config; | ||
|
|
||
| cy_cb_scb_spi_handle_events_t spi_handle_events_func; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| cy_stc_scb_spi_config_t scb_spi_config; | |
| cy_cb_scb_spi_handle_events_t spi_handle_events_func; | |
| cy_stc_scb_spi_config_t scb_spi_config; | |
| cy_cb_scb_spi_handle_events_t spi_handle_events_func; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The suggested change has been implemented.
drivers/spi/spi_ifx_cat1_pdl.c
Outdated
| } else if (channel == data->dma_tx.dma_channel) { | ||
|
|
||
| } else { | ||
| printk("Unknown\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| printk("Unknown\n"); | |
| LOG_ERR("Unknown\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The suggested change has been implemented.
drivers/spi/spi_ifx_cat1_pdl.c
Outdated
| return result; | ||
| } | ||
|
|
||
| void ifx_cat1_spi_free(const struct device *dev) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| void ifx_cat1_spi_free(const struct device *dev) | |
| void spi_free(const struct device *dev) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The suggested change has been implemented.
drivers/spi/spi_ifx_cat1_pdl.c
Outdated
| irq_disable(config->irq_num); | ||
| } | ||
|
|
||
| static void ifx_cat1_spi_irq_handler(const struct device *dev) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| static void ifx_cat1_spi_irq_handler(const struct device *dev) | |
| static void spi_irq_handler(const struct device *dev) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The suggested change has been implemented.
drivers/spi/spi_ifx_cat1_pdl.c
Outdated
| return result; | ||
| } | ||
|
|
||
| static cy_rslt_t ifx_cat1_spi_init_hw(const struct device *dev, cy_stc_scb_spi_config_t *cfg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| static cy_rslt_t ifx_cat1_spi_init_hw(const struct device *dev, cy_stc_scb_spi_config_t *cfg) | |
| static cy_rslt_t spi_init_hw(const struct device *dev, cy_stc_scb_spi_config_t *cfg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The suggested change has been implemented.
drivers/spi/spi_ifx_cat1_pdl.c
Outdated
| return result; | ||
| } | ||
|
|
||
| cy_rslt_t ifx_cat1_spi_set_frequency(const struct device *dev, uint32_t hz) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| cy_rslt_t ifx_cat1_spi_set_frequency(const struct device *dev, uint32_t hz) | |
| cy_rslt_t spi_set_frequency(const struct device *dev, uint32_t hz) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The suggested change has been implemented.
b9bf3ab to
68a01e8
Compare
- Updating spi_ifx_cat1_pdl driver to support psc3 and pse84 devices Signed-off-by: Brett Peterson <[email protected]>
- Adding kit_psc3m5_evk overlay for the spi_loopback test Signed-off-by: Brett Peterson <[email protected]>
- Adding pse84 overlay files for the spi_loopback test Signed-off-by: Brett Peterson <[email protected]>
875101e
68a01e8 to
875101e
Compare
|
|
Hi @Peterson-Brett! To celebrate this milestone and showcase your contribution, we'd love to award you the Zephyr Technical Contributor badge. If you're interested, please claim your badge by filling out this form: Claim Your Zephyr Badge. Thank you for your valuable input, and we look forward to seeing more of your contributions in the future! 🪁 |


